package com.ironman.compute.generator;


import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.RandomUtil;
import lombok.RequiredArgsConstructor;
import org.noear.snack.ONode;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class SpeedComputeDataGenerator extends ComputeDataGenerator {


    @Override
    public String topicType() {
        return "speed";
    }

    @Override
    public ONode generate() {
        return ONode.newObject()
                .set("speed", NumberUtil.round(RandomUtil.randomDouble(100.0000, 200.9999), 4).doubleValue())
                .set("standardSpeed", 150.12345);
    }

}
